/*
 * System.h
 *
 *  Created on: 22 Aug 2011
 *      Author: Allan
 */

#ifndef SYSTEM_H_
#define SYSTEM_H_

// C++ includes
#include <string>
#include <vector>
using namespace std;

// Eigen includes
#include <Eigen/Core>
using namespace Eigen;

// GeoReact includes
#include "Multiphase.h"
#include "ReactionSystem.h"

class System
{
public:
	System();
	
	System(const vector<string>& species);
	
	System(const vector<string>& species, const vector<string>& kSpecies);
	
	System(const Multiphase& multiphase, const ReactionSystem& eReactions);
	
	System(const Multiphase& multiphase, const ReactionSystem& eReactions, const ReactionSystem& kReactions);
	
	const Multiphase&
	GetMultiphase() const;
	
	const ReactionSystem&
	GetEquilibriumReactions() const;
	
	const ReactionSystem&
	GetKineticReactions() const;
	
	const Phase&
	GetPhase(const string& phasename) const;
	
	const VectorXd
	GetPhaseComposition(const string& phasename, const VectorXd& n) const;
	
	const vector<string>
	GetPrimarySpecies() const;
	
	const vector<string>
	GetEquilibriumSpecies() const;
	
	const vector<string>
	GetKineticSpecies() const;
	
	const Index
	operator[](const string& species) const;
	
	const vector<Index>
	operator[](const vector<string>& species) const;
	
	void
	Print() const;
	
protected:
	Multiphase multiphase;
	
	ReactionSystem eReactions, kReactions;
	
	map<string, Reaction> reactionMap;
	
private:
	void
	InitialiazeReactionMap();
};

#endif /* SYSTEM_H_ */
